var mysql = require('mysql');
var pool = mysql.createPool({
  host: '47.104.200.147',
  user: 'ybf',
  password: 'bing2840',
  database: 'al_interview',
  dateStrings: true
});

function db(sql = '') {
  return new Promise((reslove, reject) => {
    pool.query(sql, function (err, rows, fields) {
      if (err) throw err;
      reslove(rows);
    });
  })
}

module.exports = db;